import VueRouter from 'vue-router';

import HomeContent from '../src/components/tabbar/HomeContent.vue';
import MemberContent from '../src/components/tabbar/MemberContent.vue'
import ShopcarContent from '../src/components/tabbar/ShopcarContent.vue'
import SearchContent from '../src/components/tabbar/SearchContent.vue'
// 1
import NewsList from '../src/components/news/NewsList.vue';
import NewsInfo from '../src/components/news/NewsInfo.vue';
// 2
import PhotoList from '../src/components/photos/PhotoList.vue';
import PhotoInfo from '../src/components/photos/PhotoInfo.vue';
// 3
import GoodsList from '../src/components/goods/GoodsList.vue';
import GoodsInfo from '../src/components/goods/GoodsInfo.vue';
import GoodsDesc from '../src/components/goods/GoodsDesc.vue';
import GoodsComment from '../src/components/goods/GoodsComment.vue';

var routerObj = new VueRouter({
    routes: [
        {path: '/', redirect: '/home'},
        {path: '/home', component: HomeContent},
        {path: '/member', component: MemberContent},
        {path: '/shopcar', component: ShopcarContent},
        {path: '/search', component: SearchContent},
        // 1
        {path: '/home/newsList', component: NewsList},
        {path: '/home/newslnfo/:id', component: NewsInfo},
        // 2
        {path: '/home/photolist', component: PhotoList},
        {path: '/home/photoinfo/:id', component: PhotoInfo},
        // 3 添加name参数，指定name可以直接使用这个路由规则
        {path: '/home/goodslist', component: GoodsList},
        {path: '/home/goodsinfo/:id', component: GoodsInfo, name: 'goodsinfo'},
        {path: '/home/goodsdesc/:id', component: GoodsDesc, name: 'goodsdesc'},
        {path: '/home/goodscomment/:id', component: GoodsComment, name: 'goodscomment'},
    ],
    linkActiveClass: 'mui-active'
})
export default routerObj; 